feat: refactor partitioners - #3847
Conversation
45ad26f to
5ce56de
Compare
|
@bd713 why did you change some tests inputs? defaults should be fine, no? |
For external meshes, the default remains unchanged: ParMetis is run once with no additional refinement iteration. Matrix conversion: We also have 1 test using |
MelReyCG
left a comment
There was a problem hiding this comment.
The PR looks good to me, but I do not have knowledge in partitioners, I left some remarks:
- Should the package name be something like
partitionerrather thanmpiCommunications(or could it be splitted?)
| using namespace dataRepository; | ||
|
|
||
| class SpatialPartition; | ||
| //class SpatialPartition; |
| * @brief Get partition counts in all directions | ||
| * @return Array of partition counts {nx, ny, nz} | ||
| */ | ||
| array1d< int > const & getPartitionCounts() const { return m_partitionCounts; } |
There was a problem hiding this comment.
Why this array size is not fixed?
| array1d< int > const & getPartitionCounts() const { return m_partitionCounts; } | |
| R1Tensor const & getPartitionCounts() const { return m_partitionCounts; } |
or
| array1d< int > const & getPartitionCounts() const { return m_partitionCounts; } | |
| stackArray1D< int, 3 > const & getPartitionCounts() const { return m_partitionCounts; } |
| // Modulo | ||
| // returns a positive value regardless of the sign of numerator | ||
| real64 Mod( real64 const num, real64 const denom ) |
| */ | ||
| unsigned int getZPartitions() const { return m_partitionCounts[2]; } | ||
|
|
||
| real64 const * getLocalMin() const { return m_localMin;} |
There was a problem hiding this comment.
Feels unsafe to return an unsized array through a pointer.
| array1d< int > m_partitionCounts; | ||
|
|
||
| /// Local subdomain minimum (x, y, z) | ||
| real64 m_localMin[3]; |
| /** | ||
| * @class GraphPartitionEngine | ||
| * @brief Abstract interface for low-level graph partitioning algorithms | ||
| * | ||
| * This is a LOW-LEVEL engine for pure algorithms: graph -> partition IDs | ||
| */ | ||
| class GraphPartitionEngine : public dataRepository::Group | ||
| { |
There was a problem hiding this comment.
Does it really have to be a Group, or should it be an interface (abstract pure class / templated variant)?
| { | ||
|
|
||
| class SpatialPartition; | ||
| //class SpatialPartition; |
| ArrayOfArraysView< pmet_idx_t const, pmet_idx_t > const & graph, | ||
| arrayView1d< pmet_idx_t const > const & vertDist, |
There was a problem hiding this comment.
There is a lot of const-cast. Should we remove those const qualifier?
Description
This PR introduces a complete refactoring of GEOS's mesh partitioning system with a new architecture that separates partitioning algorithms (
engines) from domain decomposition strategies (partitioners).In practice, a new
DomainPartitionerabstract base class is introduced with two main specialized branches:The mesh partitioners leverage low-level graph partitioner engines that are independent from MPI communication:
A
PartitionerManageris introduced for creating and managing partitioner instances.XML Changes
Partitioning configuration moved from mesh-embedded to dedicated
<Partitioner>section.Before:
After:
Default behavior
If no
partitioneris prescribed, an appropriate default is selected based on mesh type:CartesianPartitionerCellGraphPartitionerwith ParMetisTo skip graph partition optimization, explicitly use
engine="noop".Testing & Rebaseline
Due to XML schema changes a rebaseline is required.
However no numerical impact is expected.
All currently failing integrated tests are due to structural changes such as: